﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Leow.SelectableCanvas">


    <Style TargetType="{x:Type local:RectangleThumb}">
        <Setter Property="Background" Value="LightSteelBlue"/>
        <Setter Property="BorderBrush" Value="SteelBlue"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:RectangleThumb}">
                    <Rectangle Fill="{TemplateBinding Background}"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}">
                    </Rectangle>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:SelectableCanvas}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:SelectableCanvas}">
                    <Border Background="{TemplateBinding Background}"
                            Margin="{TemplateBinding Margin}"
                            Padding="{TemplateBinding Padding}">
                        <ItemsPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <local:AutoResizingCanvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
